home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / AIncludes / QuickdrawText.a < prev    next >
Encoding:
Text File  |  1996-01-24  |  8.5 KB  |  416 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        QuickdrawText.a
  3. ;
  4. ;    Contains:    QuickDraw Text Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.2 in “MPW” on ETO #20
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__QUICKDRAWTEXT__') = 'UNDEFINED' THEN
  21. __QUICKDRAWTEXT__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  30.     include 'MixedMode.a'
  31.     ENDIF
  32.  
  33. ; CharToPixel directions 
  34. leftCaret                        EQU        0                    ;Place caret for left block
  35. rightCaret                        EQU        -1                    ;Place caret for right block
  36. hilite                            EQU        1                    ;Direction is SysDirection
  37. smLeftCaret                        EQU        0                    ;Place caret for left block - obsolete 
  38. smRightCaret                    EQU        -1                    ;Place caret for right block - obsolete 
  39. smHilite                        EQU        1                    ;Direction is TESysJust - obsolete 
  40. ;Constants for styleRunPosition argument in PortionLine, DrawJustified,
  41. ; MeasureJustified, CharToPixel, and PixelToChar.
  42. onlyStyleRun                    EQU        0                    ; This is the only style run on the line 
  43. leftStyleRun                    EQU        1                    ; This is leftmost of multiple style runs on the line 
  44. rightStyleRun                    EQU        2                    ; This is rightmost of multiple style runs on the line 
  45. middleStyleRun                    EQU        3                    ; There are multiple style runs on the line and this 
  46. ; is neither the leftmost nor the rightmost. 
  47. smOnlyStyleRun                    EQU        0                    ; obsolete 
  48. smLeftStyleRun                    EQU        1                    ; obsolete 
  49. smRightStyleRun                    EQU        2                    ; obsolete 
  50. smMiddleStyleRun                EQU        3                    ; obsolete 
  51.  
  52. ; type for styleRunPosition parameter in PixelToChar etc. 
  53. ; typedef short             JustStyleCode
  54. ; typedef short             FormatOrder[1]
  55. ; typedef FormatOrder         *FormatOrderPtr
  56. OffPair                 RECORD    0
  57. offFirst                 ds.w   1        ; offset: $0 (0)
  58. offSecond                 ds.w   1        ; offset: $2 (2)
  59. sizeof                     EQU *            ; size:   $4 (4)
  60.                         ENDR
  61.  
  62. ; typedef struct OffPair     OffPair
  63. ; typedef OffPair             OffsetTable[3]
  64. ;
  65. ; pascal short Pixel2Char(Ptr textBuf, short textLen, short slop, short pixelWidth, Boolean *leadingEdge)
  66. ;
  67.     IF ¬ GENERATINGCFM THEN
  68.         Macro
  69.         _Pixel2Char
  70.             dc.w     $2F3C
  71.             dc.w     $820E
  72.             dc.w     $0014
  73.             dc.w     $A8B5
  74.         EndM
  75.     ELSE
  76.         IMPORT_CFM_FUNCTION    Pixel2Char
  77.     ENDIF
  78.  
  79. ;
  80. ; pascal short Char2Pixel(Ptr textBuf, short textLen, short slop, short offset, short direction)
  81. ;
  82.     IF ¬ GENERATINGCFM THEN
  83.         Macro
  84.         _Char2Pixel
  85.             dc.w     $2F3C
  86.             dc.w     $820C
  87.             dc.w     $0016
  88.             dc.w     $A8B5
  89.         EndM
  90.     ELSE
  91.         IMPORT_CFM_FUNCTION    Char2Pixel
  92.     ENDIF
  93.  
  94. ;
  95. ; pascal short PixelToChar(Ptr textBuf, long textLength, Fixed slop, Fixed pixelWidth, Boolean *leadingEdge, Fixed *widthRemaining, JustStyleCode styleRunPosition, Point numer, Point denom)
  96. ;
  97.     IF ¬ GENERATINGCFM THEN
  98.         Macro
  99.         _PixelToChar
  100.             dc.w     $2F3C
  101.             dc.w     $8222
  102.             dc.w     $002E
  103.             dc.w     $A8B5
  104.         EndM
  105.     ELSE
  106.         IMPORT_CFM_FUNCTION    PixelToChar
  107.     ENDIF
  108.  
  109. ;
  110. ; pascal short CharToPixel(Ptr textBuf, long textLength, Fixed slop, long offset, short direction, JustStyleCode styleRunPosition, Point numer, Point denom)
  111. ;
  112.     IF ¬ GENERATINGCFM THEN
  113.         Macro
  114.         _CharToPixel
  115.             dc.w     $2F3C
  116.             dc.w     $821C
  117.             dc.w     $0030
  118.             dc.w     $A8B5
  119.         EndM
  120.     ELSE
  121.         IMPORT_CFM_FUNCTION    CharToPixel
  122.     ENDIF
  123.  
  124. ;
  125. ; pascal void DrawJustified(Ptr textPtr, long textLength, Fixed slop, JustStyleCode styleRunPosition, Point numer, Point denom)
  126. ;
  127.     IF ¬ GENERATINGCFM THEN
  128.         Macro
  129.         _DrawJustified
  130.             dc.w     $2F3C
  131.             dc.w     $8016
  132.             dc.w     $0032
  133.             dc.w     $A8B5
  134.         EndM
  135.     ELSE
  136.         IMPORT_CFM_FUNCTION    DrawJustified
  137.     ENDIF
  138.  
  139. ;
  140. ; pascal void MeasureJustified(Ptr textPtr, long textLength, Fixed slop, Ptr charLocs, JustStyleCode styleRunPosition, Point numer, Point denom)
  141. ;
  142.     IF ¬ GENERATINGCFM THEN
  143.         Macro
  144.         _MeasureJustified
  145.             dc.w     $2F3C
  146.             dc.w     $801A
  147.             dc.w     $0034
  148.             dc.w     $A8B5
  149.         EndM
  150.     ELSE
  151.         IMPORT_CFM_FUNCTION    MeasureJustified
  152.     ENDIF
  153.  
  154. ;
  155. ; pascal Fixed PortionLine(Ptr textPtr, long textLen, JustStyleCode styleRunPosition, Point numer, Point denom)
  156. ;
  157.     IF ¬ GENERATINGCFM THEN
  158.         Macro
  159.         _PortionLine
  160.             dc.w     $2F3C
  161.             dc.w     $8412
  162.             dc.w     $0036
  163.             dc.w     $A8B5
  164.         EndM
  165.     ELSE
  166.         IMPORT_CFM_FUNCTION    PortionLine
  167.     ENDIF
  168.  
  169. ;
  170. ; pascal void HiliteText(Ptr textPtr, short textLength, short firstOffset, short secondOffset, OffsetTable offsets)
  171. ;
  172.     IF ¬ GENERATINGCFM THEN
  173.         Macro
  174.         _HiliteText
  175.             dc.w     $2F3C
  176.             dc.w     $800E
  177.             dc.w     $001C
  178.             dc.w     $A8B5
  179.         EndM
  180.     ELSE
  181.         IMPORT_CFM_FUNCTION    HiliteText
  182.     ENDIF
  183.  
  184. ;
  185. ; pascal void DrawJust(Ptr textPtr, short textLength, short slop)
  186. ;
  187.     IF ¬ GENERATINGCFM THEN
  188.         Macro
  189.         _DrawJust
  190.             dc.w     $2F3C
  191.             dc.w     $8008
  192.             dc.w     $001E
  193.             dc.w     $A8B5
  194.         EndM
  195.     ELSE
  196.         IMPORT_CFM_FUNCTION    DrawJust
  197.     ENDIF
  198.  
  199. ;
  200. ; pascal void MeasureJust(Ptr textPtr, short textLength, short slop, Ptr charLocs)
  201. ;
  202.     IF ¬ GENERATINGCFM THEN
  203.         Macro
  204.         _MeasureJust
  205.             dc.w     $2F3C
  206.             dc.w     $800C
  207.             dc.w     $0020
  208.             dc.w     $A8B5
  209.         EndM
  210.     ELSE
  211.         IMPORT_CFM_FUNCTION    MeasureJust
  212.     ENDIF
  213.  
  214. ;
  215. ; pascal Fixed PortionText(Ptr textPtr, long textLength)
  216. ;
  217.     IF ¬ GENERATINGCFM THEN
  218.         Macro
  219.         _PortionText
  220.             dc.w     $2F3C
  221.             dc.w     $8408
  222.             dc.w     $0024
  223.             dc.w     $A8B5
  224.         EndM
  225.     ELSE
  226.         IMPORT_CFM_FUNCTION    PortionText
  227.     ENDIF
  228.  
  229. ;
  230. ; pascal long VisibleLength(Ptr textPtr, long textLength)
  231. ;
  232.     IF ¬ GENERATINGCFM THEN
  233.         Macro
  234.         _VisibleLength
  235.             dc.w     $2F3C
  236.             dc.w     $8408
  237.             dc.w     $0028
  238.             dc.w     $A8B5
  239.         EndM
  240.     ELSE
  241.         IMPORT_CFM_FUNCTION    VisibleLength
  242.     ENDIF
  243.  
  244. ;
  245. ; pascal void GetFormatOrder(FormatOrderPtr ordering, short firstFormat, short lastFormat, Boolean lineRight, StyleRunDirectionUPP rlDirProc, Ptr dirParam)
  246. ;
  247.     IF ¬ GENERATINGCFM THEN
  248.         Macro
  249.         _GetFormatOrder
  250.             dc.w     $2F3C
  251.             dc.w     $8012
  252.             dc.w     $FFFC
  253.             dc.w     $A8B5
  254.         EndM
  255.     ELSE
  256.         IMPORT_CFM_FUNCTION    GetFormatOrder
  257.     ENDIF
  258.  
  259.     IF OLDROUTINENAMES  THEN
  260.     ENDIF
  261. FontInfo                 RECORD    0
  262. ascent                     ds.w   1        ; offset: $0 (0)
  263. descent                     ds.w   1        ; offset: $2 (2)
  264. widMax                     ds.w   1        ; offset: $4 (4)
  265. leading                     ds.w   1        ; offset: $6 (6)
  266. sizeof                     EQU *            ; size:   $8 (8)
  267.                         ENDR
  268.  
  269. ; typedef struct FontInfo     FontInfo
  270. ; typedef short             FormatStatus
  271. ;
  272. ; pascal void TextFont(short font)
  273. ;
  274.     IF ¬ GENERATINGCFM THEN
  275.         _TextFont:    OPWORD    $A887
  276.     ELSE
  277.         IMPORT_CFM_FUNCTION    TextFont
  278.     ENDIF
  279.  
  280. ;
  281. ; pascal void TextFace(Style face)
  282. ;
  283.     IF ¬ GENERATINGCFM THEN
  284.         _TextFace:    OPWORD    $A888
  285.     ELSE
  286.         IMPORT_CFM_FUNCTION    TextFace
  287.     ENDIF
  288.  
  289. ;
  290. ; pascal void TextMode(short mode)
  291. ;
  292.     IF ¬ GENERATINGCFM THEN
  293.         _TextMode:    OPWORD    $A889
  294.     ELSE
  295.         IMPORT_CFM_FUNCTION    TextMode
  296.     ENDIF
  297.  
  298. ;
  299. ; pascal void TextSize(short size)
  300. ;
  301.     IF ¬ GENERATINGCFM THEN
  302.         _TextSize:    OPWORD    $A88A
  303.     ELSE
  304.         IMPORT_CFM_FUNCTION    TextSize
  305.     ENDIF
  306.  
  307. ;
  308. ; pascal void SpaceExtra(Fixed extra)
  309. ;
  310.     IF ¬ GENERATINGCFM THEN
  311.         _SpaceExtra:    OPWORD    $A88E
  312.     ELSE
  313.         IMPORT_CFM_FUNCTION    SpaceExtra
  314.     ENDIF
  315.  
  316. ;
  317. ; pascal void DrawChar(asciichar ch)
  318. ;
  319.     IF ¬ GENERATINGCFM THEN
  320.         _DrawChar:    OPWORD    $A883
  321.     ELSE
  322.         IMPORT_CFM_FUNCTION    DrawChar
  323.     ENDIF
  324.  
  325. ;
  326. ; pascal void DrawString(ConstStr255Param s)
  327. ;
  328.     IF ¬ GENERATINGCFM THEN
  329.         _DrawString:    OPWORD    $A884
  330.     ELSE
  331.         IMPORT_CFM_FUNCTION    DrawString
  332.     ENDIF
  333.  
  334. ;
  335. ; pascal void DrawText(const void *textBuf, short firstByte, short byteCount)
  336. ;
  337.     IF ¬ GENERATINGCFM THEN
  338.         _DrawText:    OPWORD    $A885
  339.     ELSE
  340.         IMPORT_CFM_FUNCTION    DrawText
  341.     ENDIF
  342.  
  343. ;
  344. ; pascal short CharWidth(asciichar ch)
  345. ;
  346.     IF ¬ GENERATINGCFM THEN
  347.         _CharWidth:    OPWORD    $A88D
  348.     ELSE
  349.         IMPORT_CFM_FUNCTION    CharWidth
  350.     ENDIF
  351.  
  352. ;
  353. ; pascal short StringWidth(ConstStr255Param s)
  354. ;
  355.     IF ¬ GENERATINGCFM THEN
  356.         _StringWidth:    OPWORD    $A88C
  357.     ELSE
  358.         IMPORT_CFM_FUNCTION    StringWidth
  359.     ENDIF
  360.  
  361. ;
  362. ; pascal short TextWidth(const void *textBuf, short firstByte, short byteCount)
  363. ;
  364.     IF ¬ GENERATINGCFM THEN
  365.         _TextWidth:    OPWORD    $A886
  366.     ELSE
  367.         IMPORT_CFM_FUNCTION    TextWidth
  368.     ENDIF
  369.  
  370. ;
  371. ; pascal void MeasureText(short count, const void *textAddr, void *charLocs)
  372. ;
  373.     IF ¬ GENERATINGCFM THEN
  374.         _MeasureText:    OPWORD    $A837
  375.     ELSE
  376.         IMPORT_CFM_FUNCTION    MeasureText
  377.     ENDIF
  378.  
  379. ;
  380. ; pascal void GetFontInfo(FontInfo *info)
  381. ;
  382.     IF ¬ GENERATINGCFM THEN
  383.         _GetFontInfo:    OPWORD    $A88B
  384.     ELSE
  385.         IMPORT_CFM_FUNCTION    GetFontInfo
  386.     ENDIF
  387.  
  388. ;
  389. ; pascal void CharExtra(Fixed extra)
  390. ;
  391.     IF ¬ GENERATINGCFM THEN
  392.         _CharExtra:    OPWORD    $AA23
  393.     ELSE
  394.         IMPORT_CFM_FUNCTION    CharExtra
  395.     ENDIF
  396.  
  397. ;
  398. ; pascal void StdText(short count, const void *textAddr, Point numer, Point denom)
  399. ;
  400.     IF ¬ GENERATINGCFM THEN
  401.         _StdText:    OPWORD    $A882
  402.     ELSE
  403.         IMPORT_CFM_FUNCTION    StdText
  404.     ENDIF
  405.  
  406. ;
  407. ; pascal short StdTxMeas(short byteCount, const void *textAddr, Point *numer, Point *denom, FontInfo *info)
  408. ;
  409.     IF ¬ GENERATINGCFM THEN
  410.         _StdTxMeas:    OPWORD    $A8ED
  411.     ELSE
  412.         IMPORT_CFM_FUNCTION    StdTxMeas
  413.     ENDIF
  414.  
  415.     ENDIF ; __QUICKDRAWTEXT__
  416.